package com.xdxc.emuns;

public enum GroupType {
    SINGLE_CHOICE(1, "单选题"),
    MULTI_CHOICE(2, "多选题"),
    JUDGMENT(3, "判断题"),
    FILL_BLANK(4, "填空题"),
    ESSAY(5, "问答题");

    private final int code;
    private final String name;

    GroupType (int code, String name) {
        this.code = code;
        this.name = name;
    }

    public static String getName(int code) {
        for (GroupType type : values()) {
            if (type.code == code) {
                return type.name;
            }
        }
        return "未知题型";
    }

    // getter方法
    public int getCode() { return code; }
    public String getName() { return name; }
}
